﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UCLHJinInfo2QS.ascx.cs" Inherits="Web.Controls.UCLHJinInfo2QS" %>
<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<script type="text/javascript">
    function GetValue(type) {
        if (type == 'bh') {
            return UCLHUserInfo_hdCollection.Get("bh");
        }
        else {
            return "";
        }
    }
    function UCLHUserInfo_txtBHKeyPress() {
        if (event.keyCode == 13) {
            setTimeout(function () {

            }, 0);
            event.preventDefault ? event.preventDefault() : (event.returnValue = false);
            if (UCLHUserInfo_txtJinBH.GetText() == '') {
                alert('请输入井编号。');
                UCLHUserInfo_txtLaoBH.SetText("");
                UCLHUserInfo_txtJinBH.Focus();
                return;
            }
            UCLHUserInfo_ASPxCallback1.PerformCallback("bh");
        }
        else {
            UCLHUserInfo_txtLaoBH.SetText("");
            UCLHUserInfo_txtJinDZ.SetValue("");
        }
    }

    function JinAdd() {
        if (UCLHUserInfo_txtLaoBH.GetText() == '') {
            alert('请查询出井信息。');
            UCLHUserInfo_txtJinBH.Focus();
            return;
        }
        UCLHUserInfo_ASPxCallback1.PerformCallback("add");
    }
    function UCLHUserInfo_ASPxCallbackCommonComplete(rs) {
        var arr = rs.split('|');
        var type = arr[0];
        var state = arr[1];
        var specialIdentity = arr[2];
        var msg = arr[3].split('-');
        if (msg[0] == 'True') {
            alert(msg[1]);
        }
        UCLHUserInfo_hdCollection.Set("type", type);
        if (state == 'True') {
            if (type == "bh") {
                //加载信息
                UCLHUserInfo_txtLaoBH.SetText(arr[4]);
                UCLHUserInfo_txtJinDZ.SetValue(arr[5]);
                if (typeof (UCLHUserInfo_cmbJinLX) != "undefined") {
                    UCLHUserInfo_cmbJinLX.SetValue(arr[6]);
                }
                if (typeof (UCLHUserInfo_cmbJinXZ) != "undefined") {
                    UCLHUserInfo_cmbJinXZ.SetValue(arr[7]);
                }
                if (arr.length >= 9) {
                    UCLHUserInfo_hdCollection.Set("YHH", arr[8]);
                }

            }
            else if (type == "add") {
                UCLHUserInfo_btnActPerform.onClick();
            }
        }
        else {
            if (type == "bh") {
                UCLHUserInfo_txtLaoBH.SetText("");
                UCLHUserInfo_txtJinDZ.SetValue("");
                UCLHUserInfo_hdCollection.Set("YHH", "");
            }
        }
    }   

</script>
 <div style="display:none;">
                <dx:ASPxButton ID="btnActPerform" ClientInstanceName="UCLHUserInfo_btnActPerform" runat="server" Text="ASPxButton" AutoPostBack="false" OnClick="btnActPerform_Click"></dx:ASPxButton>
                    </div>
<dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="UCLHUserInfo_hdCollection" runat="server"></dx:ASPxHiddenField>
<dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="UCLHUserInfo_ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){UCLHUserInfo_ASPxCallbackCommonComplete(e.result);}"></dx:ASPxCallback>
<fieldset style="border: 1px solid  cornflowerblue;width:97%;margin:auto;">
    <legend><b>井信息</b></legend>
    <table style="width:70%;margin:auto;">
        <tr>
            <td align="right" style="width: 20%">登记文号：
            </td>
            <td style="width: 25%">
                <dx:ASPxTextBox ID="txtLaiHanBH"   ReadOnly="true" runat="server" Width="100%" Text=""></dx:ASPxTextBox>
            </td>
            <td style="width: 20%" align="right"><%--许可证编号：--%></td>
            <td style="width: 25%">
                <dx:ASPxTextBox ID="txtXuKeZH" ReadOnly="true" runat="server" Width="100%" Text="" Visible="false"></dx:ASPxTextBox>
            </td>
        </tr>
        <tr>
            <td align="right" >井编号：
            </td>
            <td>
                <dx:ASPxTextBox ID="txtJinBH" ClientInstanceName="UCLHUserInfo_txtJinBH" runat="server" Text="" Width="100%" ClientSideEvents-KeyPress="function(s,e){UCLHUserInfo_txtBHKeyPress();}"></dx:ASPxTextBox>
            </td>
            <td align="right">原井编号：
            </td>
            <td>
                <dx:ASPxTextBox ID="txtLaoBH" ClientInstanceName="UCLHUserInfo_txtLaoBH" runat="server" Text="" Width="100%" ></dx:ASPxTextBox>
            </td>
        </tr>
        <tr>
            <td align="right">井地址：
            </td>
            <td colspan="3">
                <dx:ASPxTextBox ID="txtJinDZ" ClientInstanceName="UCLHUserInfo_txtJinDZ" runat="server" Text="" Width="100%" ClientEnabled="false"></dx:ASPxTextBox>
            </td>
        </tr>
        <tr runat="server" id="trJINLX"> 
            <td align="right">井类型(原)：
            </td>
            <td>
                <dx:ASPxComboBox ID="cmbJinLX" ClientInstanceName="UCLHUserInfo_cmbJinLX" runat="server" ValueType="System.String" ClientEnabled="false"></dx:ASPxComboBox>
            </td>
            <td align="right">井类型(现)：
            </td>
            <td>
                <dx:ASPxComboBox ID="cmbJinLXNEW" ClientInstanceName="UCLHUserInfo_cmbJinLXNEW" runat="server" ValueType="System.String"></dx:ASPxComboBox>
            </td>
        </tr>
        <tr runat="server" id="trJINZT">
            <td align="right">井性质(原)：
            </td>
            <td>
                <dx:ASPxComboBox ID="cmbJinXZ" ClientInstanceName="UCLHUserInfo_cmbJinXZ" runat="server" ValueType="System.String" ClientEnabled="false"></dx:ASPxComboBox>
            </td>
            <td align="right">井性质(现)：
            </td>
            <td>
                <dx:ASPxComboBox ID="cmbJinXZNEW" ClientInstanceName="UCLHUserInfo_cmbJinXZNEW" runat="server" ValueType="System.String"></dx:ASPxComboBox>
            </td>
        </tr>
        <tr style="display:none">
            <td align="right">用户号：
            </td>
            <td colspan="3">
                <dx:ASPxTextBox ID="txtYHH" ClientInstanceName="UCLHUserInfo_txtYHH" runat="server" Text="" Width="100%" ClientVisible="false"></dx:ASPxTextBox>
            </td>
        </tr>
        <tr style="display:none">
            <td align="right">用户名：
            </td>
            <td colspan="3">
                <dx:ASPxTextBox ID="txtYHM" ClientInstanceName="UCLHUserInfo_txtYHM" runat="server" Text="" Width="100%" ClientVisible="false"></dx:ASPxTextBox>
            </td>
        </tr>
        <tr>
            <td colspan="4" style="text-align:center">
                <dx:ASPxButton ID="btnAdd" ClientInstanceName="UCLHUserInfo_btnAdd" runat="server" Text="添加" AutoPostBack="false" ClientSideEvents-Click="function(s,e){JinAdd();}"></dx:ASPxButton>
            </td>
        </tr>
        <%--<tr>
            <td align="right">变更日期：
            </td>
            <td colspan="3">
                <dx:ASPxDateEdit ID="dtBianGengRQ" ClientInstanceName="UCLHUserInfo_dtBianGengRQ" runat="server"></dx:ASPxDateEdit>
            </td>
        </tr>--%>
    </table>
</fieldset>
